﻿using System;

class DivideBySeven
{
    static void Main()
    {
        int number = int.Parse(Console.ReadLine());

        bool divideBy5 = number % 5 == 0;
        bool divideBy7 = number % 7 == 0;
        bool divideBy5And7 = divideBy5 && divideBy7;

        Console.WriteLine(divideBy5And7);
    }    
}

